<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
	<link rel="shortcut icon" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/logo.png"/>
	<meta name="apple-mobile-web-app-capable" content="no" />
	<title>{{.title}}</title>
	<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
    <link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/mui.min.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/font/iconfont.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/all.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/app.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/ydui.css?v" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/dropload.css" rel="stylesheet" />
</head>
<style>
	.filter dl:last-child i{font-size: 7pt}
	.noproduct{height: calc(100vh - 55px);background: url('/static/wechat/img/noproduct.png') no-repeat;background-size: 63%;background-position: center;}
	.filter .ac dt{color:#e31939;}
	#price{position: relative;}
	#pirce dt{position: relative;}
	#price .iconfont{font-size: 6pt !important;margin: 0 !important;}
	#price #down{position: absolute;bottom:calc(6pt - 12px);left: 0}
	#price #up{position: absolute;top:calc(6pt - 12px);left: 0}
	#price dt div{position: absolute;height: 40px;width:6pt;top: 0;left: calc(50% + 10pt + 3px);}
	.icon-home2{position: fixed;right: 15px;bottom: 15px;background: #e31939;border-radius: 50%;color: #fff;width: 40px;height: 40px;padding: 7.5px}
	.icon-home2:before{font-size: 25px;}
	.PrdLineStyle .goto{position: relative;}
	.PrdLineStyle .goto .scadd{color:#e54242;position:absolute;bottom: 8px;right:13px;font-size: 18pt}
	.PrdLineStyle dl dd p s{color: #999;font-size: 12px;margin-left: 5px;}
	.PrdLineStyle dl .x{position: absolute;top: 0px;right:0px;z-index: 9;width: 30px;height: 30px;}
</style>
<body>
	<!-- <span class="mui-icon iconfont icon-home2 goto" href="/mobile/index"></span> -->
	<!-- <div class="search">
		<form onsubmit="return search()" action="/">
			<input type="search" placeholder="请输入搜索关键词" name="keywords" id="key">
			<input type="submit" style="display:none;">
		</form>
	</div> -->
	{{if .info}}
	<div class="PrdLineStyle">
		{{range $k,$v:=.info}}
		<dl class="goto" data-price="{{$v.price}}" data-sellnum="{{$v.sellnum}}" data-sort="{{$k}}" data-addtime="{{$v.addtime}}">
			<dt class="goto" href="/mobile/column/product_content?id={{$v.pid}}"><img src="{{$v.pathname}}" alt=""></dt>
			<dd>
				<p>{{$v.title}}</p>
				<p>{{$v.starttime}} ~ {{$v.endtime}}</p>
				<p><span><span>&yen;</span>{{if $v.vprice}}{{$v.vprice}}<s>{{$v.price}}</s>{{else}}{{$v.price}}{{end}}</span><!-- {{$v.sellnum}}人购买 --></p>
			</dd>
			<i class="iconfont scadd" data-id="{{$v.pid}}" >&#xe619;</i>
			{{if eq $v.active 1}}
			<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/gbuy.png" class="x">
			{{else if eq $v.active 2}}
			<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/sales.png" class="x">
			{{end}}
		</dl>
		{{end}}
	</div>
	{{else}}
	<div class="noproduct"></div>
	{{end}}
</body>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/sui/js/SUI.js"></script>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/zepto.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/dropload.min.js"></script>
{{template "wechat/public/share.html" .}}
<script type="text/javascript" charset="utf-8">
	var keywords2="";
		function search(){
		document.getElementById("key").blur();
		keywords2=$('input[name="keywords"]').val()
		if(keywords2==""){
			return false;
		}else{
			// $('input[name="keywords"]').val('')
			searchajax()
			return false;
		}
		return false;
	}
// 	function searchajax(){
// 		$.ajax({
// 			url:window.location.href,
// 			data:{keywords2:keywords2,statusajax:status},
// 			success:function(res){
// 				page=2
// 				var html=''
// 				if (res){
// 					for(var i=0;i<res.length;i++){
// 						html+=`<dl class="goto" href="/mobile/column/product_content?id=`+res[i].price+`" data-price="`+res[i].price+`" data-sellnum="`+res[i].sellnum+`"  data-sort="`+i+`">
// 						<dt class="goto" href="/mobile/column/product_content?id=`+res[i].id+`"><img src="`+res[i].pathname+`" alt=""></dt> <dd>
// 						<p>`+res[i].title+`</p><p>`
// 						if (res[i].keywords){
// 							for(var j=0;j<res[i].keywords.length;j++){
// 								html+=`<span>`+res[i].keywords[j].title+`</span>`
// 							}
// 						}
// 						html+=`</p><p><span><span>&yen;</span>`
// 						if(res[i].vprice){
// 							html+=res[i].vprice
// 						}else{
// 							html+=res[i].price
// 						}
// 						html+=`</span>`+res[i].sellnum+`人购买</p> </dd><i class="iconfont scadd" data-id="`+res[i].id+`" >&#xe619;</i></dl>`
// 					}
// 					$('.noproduct').css('display','none')
// 					$('.PrdLineStyle').html(html)
// 				}else{
// 					$('.PrdLineStyle').html('')
// 					$('.noproduct').css('display','block')
// 				}
// 				dropload()
// 			},
// 			error:function(){
// 				mui.toast("网络慢，请重新刷新!");
// 			}
// 		})
// 	}
// 	var status='';
// 	$('.sort').click(function(){
// 		if (status==$(this).attr('data-status')) {
// 			return false;
// 		};
// 		status=$(this).attr('data-status')
// 		if (status=='1'){
// 			$(this).attr('data-status',	0)
// 			$('#down').css('color','#333')
// 			$('#up').css('color','#e31939')
// 		}else if(status=='0'){
// 			$(this).attr('data-status',1)
// 			$('#up').css('color','#333')
// 			$('#down').css('color','#e31939')
// 		}else if(status==''||status=='2'||status=='3'){
// 			$('#up').css('color','#333')
// 			$('#down').css('color','#333')
// 		}
// 		$('#down').html('&#xe701;')
// 		$('#up').html('&#xe700;')
// 		$('.sort').attr('class','sort')
// 		$(this).attr('class','sort ac')
// 		$.ajax({
// 			url:window.location.href,
// 			data:{statusajax:status,keywords2:keywords2},
// 			success:function(res){
// 				page=2
// 				var html=''
// 				if (res){
// 					for(var i=0;i<res.length;i++){
// 						html+=`<dl class="goto" data-price="`+res[i].price+`" data-sellnum="`+res[i].sellnum+`"  data-sort="`+i+`">
// 						<dt class="goto" href="/mobile/column/product_content?id=`+res[i].id+`"><img src="`+res[i].pathname+`" alt=""></dt> <dd>
// 						<p>`+res[i].title+`</p><p>`
// 						if (res[i].keywords){
// 							for(var j=0;j<res[i].keywords.length;j++){
// 								html+=`<span>`+res[i].keywords[j].title+`</span>`
// 							}
// 						}
// 						html+=`</p><p><span><span>&yen;</span>`
// 							if(res[i].vprice){
// 								html+=res[i].vprice
// 							}else{
// 								html+=res[i].price
// 							}
// 							html+=`</span>`+res[i].sellnum+`人购买</p> </dd><i class="iconfont scadd" data-id="`+res[i].id+`" >&#xe619;</i></dl>`
// 					}
// 					$('.noproduct').css('display','none')
// 					$('.PrdLineStyle').html(html)
// 				}else{
// 					$('.PrdLineStyle').html('')
// 					$('.noproduct').css('display','block')
// 				}
// 				dropload()
// 			},
// 			error:function(){
// 				mui.toast("网络慢，请重新刷新!");
// 			}
// 		})
// 	})
// function sort(){
// 		var arr=[]
// 		$('.goto').each(function(){
// 			arr.push(this)
// 		})
// 		switch(status){
// 			case "":
// 			arr.sort(function(a,b){return parseInt(a.getAttribute('data-sort')) -  parseInt(b.getAttribute('data-sort'))});
// 			break;
// 			case "0":
// 			arr.sort(function(a,b){return parseFloat(b.getAttribute('data-price')) - parseFloat(a.getAttribute('data-price'))});
// 			break;
// 			case "1":
// 			arr.sort(function(a,b){return parseFloat(a.getAttribute('data-price')) - parseFloat(b.getAttribute('data-price'))});
// 			break;
// 			case "2":
// 			arr.sort(function(a,b){return parseInt(b.getAttribute('data-sellnum')) -  parseInt(a.getAttribute('data-sellnum'))});
// 			break;
// 			case "3":
// 			arr.sort(function(a,b){return Date.parse(new Date(b.getAttribute('data-addtime'))) -  Date.parse(new Date(a.getAttribute('data-addtime'))) });
// 			break;
// 		}
// 		$('.PrdLineStyle').html('')
// 		for(var i=0;i<arr.length;i++){
// 			$('.PrdLineStyle').append(arr[i])
// 		}
// 	}
// var page=2
// function dropload(){
// $('.element').dropload({
//     scrollArea : window,
//     loadDownFn : function(me){
//         $.ajax({
//             type: 'GET',
//             url: window.location.href,
//             dataType: 'json',
//             data:{page:page,statusajax:status,keywords2:keywords2},
//             success: function(res){
//                page+=1
//               if(res){
//               	 var godom=document.getElementsByClassName('goto')
//               	 var k=parseInt(godom[godom.length-1].getAttribute('data-sort'))
//                  for (var i=0;i<res.length;i++){
//              		k=k+1
//                     var dl = document.createElement('dl');
//                     dl.className="goto"	
//                     dl.setAttribute('data-price',res[i].price)
//                     dl.setAttribute('data-sellnum',res[i].sellnum)
//                     dl.setAttribute('data-sort',k)
//                     dl.setAttribute('data-addtime',res[i].addtime)
//  					var	html=`<dt class="goto" href="/mobile/column/product_content?id=`+res[i].id+`"><img src="`+res[i].pathname+`" alt=""></dt>
// 					<dd>
// 						<p>`+res[i].title+`</p><p>`
// 						if (res[i].keywords){
// 							for(var j=0;j<res[i].keywords.length;j++){
// 								html+=`<span>`+res[i].keywords[j].title+`</span>`
// 							}
// 						}
// 						html+=`</p><p><span><span>&yen;</span>`
// 							if(res[i].vprice){
// 								html+=res[i].vprice
// 							}else{
// 								html+=res[i].price
// 							}
// 							html+=`</span>`+res[i].sellnum+`人购买</p> </dd><i class="iconfont scadd" data-id="`+res[i].id+`" >&#xe619;</i>`
//                     dl.innerHTML=html
//                     document.getElementsByClassName('PrdLineStyle')[0].appendChild(dl)
//                 }
//                 me.resetload();
//                 }else{
//                     mui.toast("没有更多了！");
//                     $(".dropload-down").remove();
//                 }
//             },
//             error: function(xhr, type){
//                 mui.toast("网络慢，请重新刷新!");
//                 me.resetload();
//             }
//         });
//     }
// });
	
// }
// dropload()
mui('body').on('tap','.goto',function(){
	var u=this.getAttribute('href')
	if(u){
		window.location.href=u
	}
})
function stopPropagation(e) {  
    if (e.stopPropagation) {  
        e.stopPropagation();  
    } else {  
        e.cancelBubble = true;  
    }  
}  
mui('body').on('tap','.scadd',function(e){
	// stopPropagation(e)
	var pid=this.getAttribute("data-id")
	var data={num:1,pid:pid}
	mui.post('/mobile/shopcar',data,function(res){
		if(res==2||res==962){
			mui.confirm("您还未登入,请先登入","提示",function(res){
				if(res.index){
					mui.closePopups()
					window.location.href="/mobile/login"
				}
			})
		}else if(res==1){
			mui.toast("添加成功~")
		}else if(res==0){
			mui.toast("网络繁忙,请重试!")
		}else if(res==3){
          mui.toast('库存不足');
        }
	})
})
</script>
</html>